package com.wilmer.consultants_order.mapper;

import java.util.List;
import com.wilmer.consultants_order.domain.BankConsultantsOrder;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 顾问订单Mapper接口
 * 
 * @author hans
 * @date 2024-04-01
 */
public interface BankConsultantsOrderMapper 
{
    /**
     * 查询顾问订单
     * 
     * @param id 顾问订单主键
     * @return 顾问订单
     */
    public BankConsultantsOrder selectBankConsultantsOrderById(Long id);

    /**
     * 查询顾问订单列表
     * 
     * @param bankConsultantsOrder 顾问订单
     * @return 顾问订单集合
     */
    public List<BankConsultantsOrder> selectBankConsultantsOrderList(BankConsultantsOrder bankConsultantsOrder);

    /**
     * 新增顾问订单
     * 
     * @param bankConsultantsOrder 顾问订单
     * @return 结果
     */
    public int insertBankConsultantsOrder(BankConsultantsOrder bankConsultantsOrder);

    /**
     * 修改顾问订单
     * 
     * @param bankConsultantsOrder 顾问订单
     * @return 结果
     */
    public int updateBankConsultantsOrder(BankConsultantsOrder bankConsultantsOrder);

    /**
     * 删除顾问订单
     * 
     * @param id 顾问订单主键
     * @return 结果
     */
    public int deleteBankConsultantsOrderById(Long id);

    /**
     * 批量删除顾问订单
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBankConsultantsOrderByIds(Long[] ids);

    @Update("update bank_consultants_order set pay=1 where order_num=#{orderNum}")
    public int updateOrder(String orderNum);

    @Update("update bank_consultants_order set pay=1 where order_num=#{orderNum}")
    public int getStatus(String orderNum);

    @Select("select con_id from bank_consultants_order where user_id=#{userId} and pay=1")
    public List<Long> getConId(Long userId);


}
